import i18n from '@/locale'

const routeMenuList = {
  state: {
    menuList: [],
    checkModuleMenuName: sessionStorage.getItem('productName') || i18n.t('changeProduct')
  },
  mutations: {
    SET_MENULIST: (state, menuList) => {
      state.menuList = menuList
    },
    SET_CHECKMODULEMENU: (state, name) => {
      state.checkModuleMenuName = name
    }
  },
  actions: {
    getRouterMenuList({ commit }, routeMenu) {
      commit('SET_MENULIST', routeMenu)
    },
    setModuleMenuName({ commit }, name) {
      commit('SET_CHECKMODULEMENU', name)
    }
  }
}
export default routeMenuList
